home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Internet / FeedDemon / FeedDemonInstall.exe / {app} / Data / Subscriptions.xsl < prev   
Encoding:
Extensible Markup Language  |  2009-09-08  |  14.9 KB  |  427 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
  6.     
  7. <xsl:output method="html"
  8.     doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  9.     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  10.  
  11. <xsl:variable name="num_unread_feeds" select="count(opml/body/outline[@numUnread > 0])"/>
  12.  
  13. <xsl:template match="opml">
  14.  
  15. <xsl:variable name="rpt-title" select="head/title"/>
  16. <html>
  17. <head>
  18.     <title><xsl:value-of select="$rpt-title"/></title>
  19.     $INCLUDE(metatrans.inc)$
  20.     <style type="text/css">
  21.         $INCLUDE(surfer.css)$
  22.  
  23.         ul, ol { margin: 0; }
  24.         li { font-size: 92%; vertical-align: middle; }
  25.         
  26.         #container {
  27.             /* without this, content may be jumbled together when news item list shown */
  28.             min-width: 600px;
  29.         }
  30.         .groupheader {    padding-left: 24px; }
  31.         #topposts, #summary-items, .feedlist, #tagcloud { margin: 24px 32px; }
  32.         
  33.         #column-sidebar {
  34.             position: absolute;
  35.             top: 0;
  36.             right: 0;
  37.             width: 350px;
  38.             border-left: 1px dotted $COLOR-SIDEBAR-BORDER$;
  39.         }
  40.         #column-middle { 
  41.             position: absolute;
  42.             top: 0;
  43.             left: 0;
  44.             padding-right: 350px;    
  45.         }
  46.         #actionlinks {
  47.             font-weight: normal;
  48.             margin-top: 10px;
  49.             border-top: 1px dotted $COLOR-SIDEBAR-BORDER$;
  50.             padding-top: 10px;
  51.         }
  52.         #actionlinks li { list-style-type: none; }
  53.         #actionlinks #httperrors {
  54.             border-top: 1px dotted $COLOR-SIDEBAR-BORDER$;
  55.             border-bottom: 1px dotted $COLOR-SIDEBAR-BORDER$;
  56.             margin-top: 12px;
  57.             padding: 3px 0;
  58.         }
  59.  
  60.         div.toppost-title {
  61.             font-weight: bold;
  62.             margin-top: 12px;
  63.             margin-bottom: 2px;
  64.         }
  65.         /* IE shows caret rather than hand pointer w/o this! */
  66.         div.toppost-title a:hover {
  67.             cursor: hand;
  68.         }
  69.         span.toppost-title-unread, span.toppost-title-read {
  70.             max-width: 75%;
  71.             overflow: hidden;
  72.             display: inline-block;
  73.             text-overflow: ellipsis;
  74.             white-space: nowrap;            
  75.         }
  76.         /* currently no difference between read/unread titles */
  77.         .toppost-title-read {  }
  78.         .toppost-title-unread { }
  79.         
  80.         div.toppost-text {
  81.             font-size: 92%;
  82.             line-height: 1.4em;
  83.             margin-bottom: 18px;
  84.         }
  85.         div.toppost-text a {
  86.             /* don't allow hyperlink styles in the feed to set color/weight */
  87.             color:  $COLOR-HYPERLINK$ !important;
  88.             font-weight: normal !important;
  89.         }
  90.         
  91.         div#topvideos {
  92.             text-align: center;
  93.             margin-bottom: 18px;
  94.         }
  95.         
  96.         img.videothumb {
  97.             width: 60px;
  98.             height: 45px;
  99.             margin: 2px;
  100.             background-image: url($IMAGEDIR$video-border.png);
  101.             background-position: top left;
  102.             background-repeat: repeat-y;
  103.             padding-left: 8px;
  104.         }
  105.         a img.videothumb {
  106.             border: 1px solid #3f3f3f;
  107.         }
  108.         /*    highlight videos the user hasn't seen yet*/
  109.         a:link img.videothumb  { border-color: highlight; }
  110.  
  111.         div.showall {
  112.             float: right;
  113.             font-size: 85%;
  114.             font-weight: bold;
  115.             margin-right: 24px;
  116.         }
  117.  
  118.         .task-box, .task-box-important { padding: 14px 18px; margin: 10px; }
  119.         .task-box {
  120.             color: $COLOR-SIDEBAR-FONT$;
  121.             background-color: $COLOR-SIDEBAR$;
  122.             border: 1px solid $COLOR-SIDEBAR-BORDER$;
  123.         }
  124.         .task-box-important {
  125.             color: #b22222;
  126.             background-color: #fae4e4;
  127.             border: 1px solid #b22222;
  128.         }
  129.         .task-box-important a { color: #b22222; text-decoration: underline; }
  130.         .task-text { text-align: center; font-size: 85%; }
  131.  
  132.         img.icon { margin-left: 4px; }
  133.         img.newtabicon { vertical-align: top;    }
  134.         img.favicon { margin-right: 6px; zoom: 75%; }
  135.  
  136.         .feedlist { 
  137.             margin-top: 16px;
  138.         }
  139.         .feedlist li {
  140.             /*list-style-type: none;*/
  141.             padding-bottom: 2px;
  142.             margin-left: 24px;
  143.         }
  144.         .feedtitle {
  145.             overflow: hidden;
  146.             display: inline-block;
  147.             text-overflow: ellipsis;
  148.             white-space: nowrap;
  149.             max-width: 210px;
  150.         }
  151.         .feedlist .unreadcount { color: $COLOR-UNREAD-COUNT$; }
  152.  
  153.         span.tag { margin-right: 4px;    }
  154.         .cloud-rank0 { font-size: smaller; }
  155.         .cloud-rank1 {  }
  156.         .cloud-rank2 {    font-size: larger; font-weight: bold; }
  157.         .tagcount {    display: none;    } 
  158.  
  159.         div.groupheader a { text-decoration: underline; }
  160.  
  161.         .notags, .noattention, .notopposts { 
  162.             margin: 12px 20px; 
  163.             max-width: 300px;
  164.             color: #A9A9A9;
  165.         }
  166.         
  167.         form#searchbar {
  168.             float: right;
  169.             margin-right: 12px;
  170.         }
  171.     </style>
  172. </head>
  173. <body>
  174.     <xsl:variable name="folderId" select="@folderId"/>    
  175.             
  176.     <div id="pagehead">
  177.         <!-- search form -->
  178.         <!-- <form id="searchbar" method="get" action="fdaction:" title="$LANG_CONST(S_Action_Search)$">
  179.             <input id="searchkeyword" size="30" type="text" maxlength="255" name="keyword" value="" />
  180.             <input type="hidden" name="action" value="searchsubscriptions"/>
  181.         </form> -->
  182.         <div id="newspapertitle">
  183.             <xsl:choose>
  184.                 <xsl:when test="$num_unread_feeds=0"><img src="$IMAGEDIR$subscriptions-lg.png" align="absmiddle" /></xsl:when>
  185.                 <xsl:otherwise><a href="fdaction:?action=markallfeedsread" title="$LANG_CONST(S_MarkAllFeedsRead)$"><img src="$IMAGEDIR$subscriptions-unread-lg.png" align="absmiddle" /></a></xsl:otherwise>
  186.             </xsl:choose>
  187.             
  188.             <xsl:value-of select="$rpt-title"/>
  189.         </div>
  190.     </div>
  191.     <div id="container">
  192.         <div id="column-sidebar">
  193.             <!-- tasks -->
  194.             <xsl:if test="body/tasks">
  195.                     <xsl:for-each select="body/tasks/task">
  196.                         <xsl:variable name="taskboxclass">
  197.                             <xsl:choose>
  198.                                 <xsl:when test="@isImportant">task-box-important</xsl:when>
  199.                                 <xsl:otherwise>task-box</xsl:otherwise>
  200.                             </xsl:choose>
  201.                         </xsl:variable>                    
  202.                         <div class="{$taskboxclass}"><div class="task-text"><xsl:value-of select="." disable-output-escaping="yes"/></div></div>
  203.                     </xsl:for-each>
  204.             </xsl:if>
  205.             
  206.             <!-- summary -->
  207.              <xsl:call-template name="showsummary"/>            
  208.             <!-- attention -->
  209.             <xsl:call-template name="showattention"/>
  210.             <!-- tag cloud -->
  211.             <xsl:call-template name="showtagcloud"/>
  212.         </div>
  213.  
  214.         <div id="column-middle">
  215.             <!-- top posts (popular topics) -->
  216.             <xsl:call-template name="showtopposts"/>
  217.         </div>
  218.     </div>
  219.     </body>
  220. </html>
  221. </xsl:template>
  222. <!-- end main template -->
  223.  
  224. <!-- ********************************************************************************************** -->
  225. <!-- summary template -->
  226. <!-- ********************************************************************************************** -->
  227. <xsl:template name="showsummary">
  228.     <div class="groupheader"><!-- no group heading --></div>
  229.  
  230.     <div id="summary-items">
  231.         <div>
  232.             <a href="fdaction:?action=shownewspaper&filter=unread"><strong>$LANG_CONST(S_FilterName_Unread)$:</strong></a>  <xsl:value-of select="counts/@numUnread"/>
  233.         </div>
  234.         <div>
  235.             <a href="fdaction:?action=shownewspaper&filter=flagged"><strong>$LANG_CONST(S_FilterName_Flagged)$:</strong></a>  <xsl:value-of select="counts/@numFlagged"/>
  236.         </div>
  237.         <ul id="actionlinks">
  238.             <li><a href="fdaction:?action=searchsubscriptions&showdialog=1">$LANG_CONST(S_Action_Search)$...</a></li>
  239.             <li><a href="fdaction:?action=runcleanup">$LANG_CONST(S_Action_Cleanup)$...</a></li>
  240.             <xsl:choose>
  241.                 <xsl:when test="$IS-OFFLINE$!=0"><li><a href="fdaction:?action=toggleoffline">$LANG_CONST(S_Action_WorkOnline)$</a></li></xsl:when>
  242.                 <xsl:otherwise><li><a href="fdaction:?action=toggleoffline">$LANG_CONST(S_Action_WorkOffline)$</a></li></xsl:otherwise>
  243.             </xsl:choose>
  244.             <li><a href="fdaction:?action=showdinosaurs">$LANG_CONST(S_Action_ShowDinosaurs)$</a></li>
  245.             <li><a href="fdaction:?action=viewfaq">$LANG_CONST(S_Action_ShowFAQ)$</a></li>
  246.             <!-- add link to HTTP error report if any errors exist -->
  247.             <xsl:if test="counts/@numHttpErrors">
  248.                 <li id="httperrors"><a href="fdaction:?action=showhttperrors">$LANG_CONST(S_Action_ShowHttpErrors)$:</a>  <xsl:value-of select="counts/@numHttpErrors"/></li>
  249.             </xsl:if>            
  250.             <!-- choose sync platform  - only shown when not synching -->
  251.             <xsl:if test="$SHOW_CHOOSE_SYNC_PLATFORM_LINK$=1">
  252.                 <li style="margin-top:20px;"><a href="fdaction:?action=choosesyncplatform">$LANG_CONST(S_Action_ChooseSyncPlatform)$</a></li>
  253.             </xsl:if>
  254.         </ul>
  255.     </div>
  256. </xsl:template>
  257.  
  258. <!-- ********************************************************************************************** -->
  259. <!-- tag cloud template -->
  260. <!-- ********************************************************************************************** -->
  261. <xsl:template name="showtagcloud">
  262.     <div id="tag-container">
  263.         <div class="groupheader">
  264.             <div class="showall"><a href="fdaction:?action=managetags">$LANG_CONST(S_NewsLblManageTags)$</a></div>
  265.             $LANG_CONST(S_NewsLblMyTags)$
  266.         </div>
  267.         <xsl:choose>
  268.             <xsl:when test="cloud/tag">
  269.                 <div id="tagcloud">
  270.                     <xsl:for-each select="cloud/tag">
  271.                         <xsl:sort select="." data-type="text"/>
  272.                         <xsl:variable name="cloud-class">
  273.                             <xsl:choose>
  274.                                 <xsl:when test="@rank=0">cloud-rank0</xsl:when>
  275.                                 <xsl:when test="@rank=1">cloud-rank1</xsl:when>
  276.                                 <xsl:otherwise>cloud-rank2</xsl:otherwise>
  277.                             </xsl:choose>
  278.                         </xsl:variable>
  279.                         <span class="tag">
  280.                             <a class="{$cloud-class}" href="fdaction:?action=showpostswithtag&tag={.}" title="$LANG_CONST(S_NewsHintShowTag)$ ({@count})">
  281.                                 <xsl:value-of select="."/> 
  282.                             </a>
  283.                             <span class="tagcount"> (<xsl:value-of select="@count"/>)</span>
  284.                         </span>                            
  285.                     </xsl:for-each>
  286.                 </div>
  287.             </xsl:when>
  288.             <xsl:otherwise>
  289.                 <!-- no items have been tagged yet -->
  290.                 <div class="notags">
  291.                     <img src="$IMAGEDIR$tag.png" align="absmiddle" /> $LANG_CONST(S_NewsLblNoTags)$
  292.                 </div>
  293.             </xsl:otherwise>
  294.         </xsl:choose>
  295.     </div>
  296. </xsl:template>
  297.  
  298. <!-- ********************************************************************************************** -->
  299. <!-- attention template -->
  300. <!-- ********************************************************************************************** -->
  301. <xsl:template name="showattention">
  302.     <!-- attention report skips feeds that the user hasn't been subscribed to for at least two days -->
  303.     <xsl:variable name="nds_attention" select="body/outline[@attentionRank and (@collectAttention='true') and (@daysSubscribed > 1)]"/>
  304.  
  305.     <div id="attention-container">    
  306.         <xsl:choose>
  307.             <xsl:when test="count($nds_attention)=0">
  308.                 <!-- show note about FD needing a few days to collect attention data -->
  309.                 <div class="groupheader">$LANG_CONST(S_AttentionInfoHdr)$</div>
  310.                 <div class="noattention">$LANG_CONST(S_AttentionInfo)$</div>
  311.             </xsl:when>
  312.             <!-- most attention -->
  313.             <xsl:when test="$SHOW-MOST-ATTENTION$!=0">
  314.                 <div class="groupheader">
  315.                 <div class="showall"><a href="fdaction:?action=showattentionreport">$LANG_CONST(S_ShowAll)$</a></div>            
  316.                     $LANG_CONST(S_NewsHdrFavoriteFeeds)$
  317.                 </div>
  318.                 <ol class="feedlist attention" id="most_attention">
  319.                     <xsl:for-each select="$nds_attention">
  320.                         <xsl:sort select="@attentionRank" data-type="number" order="descending"/>
  321.                         <xsl:if test="position() <= 10">
  322.                             <xsl:call-template name="feed"/>
  323.                         </xsl:if>
  324.                     </xsl:for-each>
  325.                 </ol>
  326.             </xsl:when>
  327.             <!-- least attention -->
  328.             <xsl:when test="$SHOW-LEAST-ATTENTION$!=0">
  329.                 <div class="groupheader">
  330.                     $LANG_CONST(S_NewsHdrLeastFavoriteFeeds)$
  331.                 </div>
  332.                 <ol class="feedlist attention" id="least_attention">
  333.                     <xsl:for-each select="$nds_attention">
  334.                         <xsl:sort select="@attentionRank" data-type="number" order="ascending"/>
  335.                         <xsl:if test="position() <= 10">
  336.                             <xsl:call-template name="feed"/>
  337.                         </xsl:if>
  338.                     </xsl:for-each>
  339.                 </ol>
  340.             </xsl:when> 
  341.         </xsl:choose>
  342.     </div>
  343. </xsl:template>
  344.  
  345. <!-- ********************************************************************************************** -->
  346. <!-- top posts/videos template -->
  347. <!-- ********************************************************************************************** -->
  348. <xsl:template name="showtopposts">
  349.     <div class="groupheader">
  350.         <div class="showall"><a href="fdaction:?action=populartopics">$LANG_CONST(S_ShowAll)$</a></div>
  351.         $LANG_CONST(S_PopularTopics_Me)$
  352.     </div>
  353.     <div id="topposts">
  354.         <xsl:if test="topVideos">
  355.             <div id="topvideos">
  356.                 <xsl:for-each select="topVideos/video">
  357.                     <xsl:sort select="@dateSortKey" data-type="number" order="descending"/>                        
  358.                     <a href="{@url}" title="{@title}"><img class="videothumb" src="{@thumbnail}" /></a>
  359.                 </xsl:for-each>
  360.             </div>
  361.         </xsl:if>
  362.         <xsl:choose>
  363.             <xsl:when test="topPosts">
  364.                 <xsl:for-each select="topPosts/post">
  365.                     <xsl:sort select="@dateSortKey" data-type="number" order="descending"/>
  366.                     <xsl:variable name="titleclass">
  367.                         <xsl:choose>
  368.                             <xsl:when test="read=0">toppost-title-unread</xsl:when>
  369.                             <xsl:otherwise>toppost-title-read</xsl:otherwise>
  370.                         </xsl:choose>
  371.                     </xsl:variable>                    
  372.                     <div class="toppost-title">
  373.                     <!-- $FAVICON(<xsl:value-of select="@feedId"/>)$ -->
  374.                         <a href="fdaction:?action=gotopost&feedid={@feedId}&postid={@postId}&markpostread=1" title="{@title}">
  375.                             <span class="{$titleclass}"><xsl:value-of select="@title" disable-output-escaping="yes"/></span>
  376.                         </a>
  377.                         <a href="fdaction:?action=gotopostlink&newtab=1&feedid={@feedId}&postid={@postId}" title="$LANG_CONST(S_NewsHintOpenInNewTab)$">
  378.                             <img class="icon newtabicon" src="$IMAGEDIR$linknew.gif" align="absmiddle" />
  379.                         </a>
  380.                     </div>
  381.                     <div class="toppost-text">
  382.                         <xsl:value-of select="." disable-output-escaping="yes"/>
  383.                     </div>
  384.                 </xsl:for-each>
  385.             </xsl:when>
  386.             <xsl:otherwise>
  387.                 <div class="notopposts">$LANG_CONST(S_NewsLblNoMemesShort)$</div>
  388.             </xsl:otherwise>
  389.         </xsl:choose>
  390.     </div>
  391. </xsl:template>
  392.  
  393. <!-- ********************************************************************************************** -->
  394. <!-- individual feed template -->
  395. <!-- ********************************************************************************************** -->
  396. <xsl:template name="feed">
  397.     <li>
  398.         <xsl:variable name="feedId" select="@feedId"/>
  399.         <xsl:variable name="numunread" select="@numUnread"/>
  400.         <xsl:variable name="numflagged" select="@numFlagged"/>
  401.         <xsl:variable name="show-favicons" select="$SHOW-FAVICONS$"/>
  402.  
  403.         <xsl:variable name="feedclass">
  404.             <xsl:choose>
  405.                 <xsl:when test="$numunread > 0 and $numflagged > 0">unread flagged</xsl:when>
  406.                 <xsl:when test="$numunread > 0">unread</xsl:when>
  407.                 <xsl:when test="$numflagged > 0">flagged</xsl:when>
  408.                 <xsl:otherwise>normal</xsl:otherwise>
  409.             </xsl:choose>
  410.         </xsl:variable>
  411.  
  412.         <!-- feed favicon -->
  413.         <xsl:if test="$show-favicons=1">$FAVICON(<xsl:value-of select="$feedId"/>)$</xsl:if>
  414.         
  415.         <!-- feed title -->        
  416.         <a class="feedtitle {$feedclass}" href="fdaction:?action=gotofeed&feedid={$feedId}" title="$LANG_CONST(S_NewsHintGotoFeed)$">
  417.             <xsl:value-of select="@title" disable-output-escaping="yes"/>
  418.         </a>
  419.  
  420.         <!-- unread count -->
  421.         <xsl:if test="$numunread > 0">
  422.             <span class="unreadcount"> (<xsl:value-of select="$numunread"/>)</span>
  423.         </xsl:if>
  424.     </li>
  425. </xsl:template>
  426.  
  427. </xsl:stylesheet>